/*
class Animal {
    String name;
    int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println(name + "吃饭");
    }
}

class Cat extends Animal {
    public Cat(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println(name + "吃鱼~~~");
    }

    public void mew() {
        System.out.println(name + "喵喵叫");
    }
}


class Dog extends Animal {
    public Dog(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println(name + "吃骨头~~~");
    }

    public void bark() {
        System.out.println(name + "汪汪叫");
    }
}

class Test {
    public static void main(String[] args) {
        Animal animal = new Dog("小狗", 1);
        if(animal instanceof Cat){
            Cat cat = (Cat)animal;
            cat.mew();
        }else {
            System.out.println("dog 无法转化为 cat");
        }
    }
}*/



class B {
    public B() {
        // do nothing
        func();
    }
    public void func() {
        System.out.println("B.func()");
    }
}
class D extends B {
    private int num = 1;

    @Override
    public void func() {
        System.out.println("D.func() " + num);
    }
}

public class Test {
    public static void main(String[] args) {
        D d = new D();
    }
}

